﻿using System.Collections.Generic;

namespace Cms.Domain
{
    public class Permission
    {
        private IList<AdministratorGroup> _groups;
        private IList<Permission> _subPermissions;

        public Permission()
        {
            _subPermissions = new List<Permission>();
            _groups = new List<AdministratorGroup>();
        }

        public virtual int ID { get; set; }

        public virtual string Name { get; set; }

        public virtual Permission Parent { get; set; }

        public virtual IList<Permission> SubPermissions
        {
            get { return _subPermissions; }
            set { _subPermissions = value; }
        }

        public virtual int SortIndex { get; set; }

        public virtual IList<AdministratorGroup> Groups
        {
            get { return _groups; }
            set { _groups = value; }
        }
    }
}